IF OBJECT_ID('ssf.ptx_get_task_group_execution_plan') IS NOT NULL
	DROP FUNCTION ssf.ptx_get_task_group_execution_plan
GO

CREATE FUNCTION ssf.ptx_get_task_group_execution_plan (
	@task_group_id INT
)
RETURNS TABLE
AS
/*
<object_header>

<object_summary>
	<purpose><![CDATA[

	]]></purpose>
</object_summary>

</object_header>
*/

	RETURN (
		SELECT l.dependency_level
			, t.*
		FROM ssf.ptx_get_task_group_dependency_level(@task_group_id) l
		JOIN ssf.ptx_task t
		ON l.task_id = t.task_id
	)
GO
